<template>
	<view class="w-indexBarItem" :class="['index-item-position-' + index]">
		<slot></slot>
	</view>
</template>

<script>
	export default {
		name: 'w-indexBarItem',
		props: {
			index: {
				type: [String, Number]
			},
		},
		methods: {
			selectorQueryPromise() {
				return new Promise((resove, reject) => {
					uni.createSelectorQuery()
						.in(this)
						.select('.index-item-position-' + this.index)
						.boundingClientRect((data) => {
							resove(data)
						})
						.exec();
				})
			}
		},
	}
</script>
